﻿<UserControl x:Class="Atlanchim.Crm.Mui.Pages.Actions.PageEditAction"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
             xmlns:lmondeilConverters="clr-namespace:Atlanchim.Crm.Mui.Pages.Actions"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="20"/>
            <RowDefinition Height="20"/>
            <RowDefinition/>
        </Grid.RowDefinitions>

        <!--Entête-->
        <StackPanel Orientation="Horizontal">
            <TextBlock Text="Action" Style="{StaticResource Heading2}" />
        </StackPanel>

        <!--Actions-->
        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
            <mui:ModernButton Content="Enregistrer"
                          Command="{Binding Path=SaveCommand}" CommandParameter="{Binding}"
                          IconData="{DynamicResource LmondeilSaveButtonPath}" Foreground="{DynamicResource LmondeilSaveButtonColor}" />
            <mui:ModernButton Content="Annuler"
                              Margin="10,0,0,0"
                          Command="{Binding Path=CancelCommand}" CommandParameter="{Binding}"
                          IconData="{DynamicResource LmondeilCancelButtonPath}" Foreground="{DynamicResource LmondeilCancelButtonColor}" />
        </StackPanel>

        <!--informations sur l'action-->
        <Grid Grid.Row="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120"/>
                <ColumnDefinition Width="5"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="30"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="*"/>
                <RowDefinition/>
            </Grid.RowDefinitions>

            <Rectangle Fill="{DynamicResource ResourceKey=ActionColor}" Grid.RowSpan="4"/>
            
            <TextBlock Text="Type" Grid.Row="0" Grid.Column="0"
                     VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,10,12" Style="{DynamicResource MandatoryTextBlock}" />
            <ComboBox Text="{Binding Action.Type, FallbackValue=[Type]}" 
                      ItemsSource="{Binding Source={StaticResource  ResourceKey=ActionTypes}}"
                      Grid.Row="0" Grid.Column="2" 
                      VerticalAlignment="Center" />

            <TextBlock Text="Date" Grid.Row="1" Grid.Column="0"
                     VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,12,10,12" Style="{DynamicResource MandatoryTextBlock}" />
            <DatePicker SelectedDate="{Binding Action.Date, FallbackValue=[Date]}" SelectedDateFormat="Short" Grid.Row="1" Grid.Column="2" 
                     VerticalAlignment="Center" FontSize="16" Height="26" Margin="2"/>

            <TextBlock  Text="Titre" Grid.Row="2" Grid.Column="0"
                     VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,7,10,7" Style="{DynamicResource MandatoryTextBlock}" />
            <TextBox Text="{Binding Action.Titre, FallbackValue=[Titre]}" 
                       Grid.Row="2" Grid.Column="2" VerticalAlignment="Center" Height="22" Margin="2" />

            <TextBlock  Text="Description" Grid.Row="3" Grid.Column="0"
                     VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,6,10,25" />
            <TextBox Text="{Binding Action.Description, FallbackValue=[Description]}" 
                     AcceptsReturn="True"
                     Grid.Row="3" Grid.Column="2" VerticalAlignment="Stretch" Margin="2"/>

        </Grid>
    </Grid>
</UserControl>